package com.mar.bt.server.impl;

import java.io.OutputStream;

import net.java.dev.marge.entity.ServerDevice;
import net.java.dev.marge.factory.CommunicationFactory;
import net.java.dev.marge.factory.L2CAPCommunicationFactory;

import com.mar.bt.server.IBluetoothIOHandler;

public class L2CAPBluetoothServer extends BluetoothServer {

	@Override
	protected IBluetoothIOHandler createBTIOHandler(final ServerDevice serviceDevice) {
		return new BluetoothIOHandler(serviceDevice){
			@Override
			protected OutputStream createOutputStream() {
				return new BTL2CAPOutputStream(serviceDevice);
			}
		};
	}

	@Override
	protected CommunicationFactory createCommunicationFactory() {
		L2CAPCommunicationFactory l2capComFactory = new L2CAPCommunicationFactory();
		return l2capComFactory;
	}
}
